<script setup>
import { ref } from 'vue'
import FanTimePicker from '..'


const show = ref(true)
const value = ref(['00', '03', '23'])

const onConfirm = (val) => {
  console.log(val)
  console.log(value.value)
}

const onFilter = (type, opt) => {
  if (type === 'hours') return opt.map(item => `${item}时`)
  if (type === 'minute') return opt.map(item => `${item}分`)
  if (type === 'second') return opt.map(item => `${item}秒`)
  return opt
}
</script>

<template>
  <demo-block title="基础用法">
    <FanTimePicker v-model="value" v-model:show="show" second :filter="onFilter" @confirm="onConfirm" />
  </demo-block>
</template>
